/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AgendaView.java
 *
 * Created on 30/10/2009, 14:49:11
 */

package view.execucao;

import Util.*;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.io.File;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import model.execucao.Agenda;
import model.execucao.ProcAtivDao;
import model.execucao.Transicao;
import view.sistema.Principal;

/**
 *
 * @author Administrador
 */
public class AgendaView extends javax.swing.JInternalFrame {

    /** Creates new form AgendaView */
    public AgendaView(Principal principal) {
        initComponents();
        dtformat = new SimpleDateFormat("dd/MM/yyyy");
        inicializaMenu();
        jbtpesqusar.doClick();
        this.principal = principal;
        new Task(300,this);
        jtbtarefas.getSelectionModel().addListSelectionListener(selectionListener);
        jtbtarefas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        //pane.add(desc);

        //Cria a reorganização da tabela através do clique na coluna
        jtbtarefas.setAutoCreateRowSorter(true);
        TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(jtbtarefas.getModel());
        jtbtarefas.setRowSorter(sorter);



    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jPopupMenu1 = new javax.swing.JPopupMenu();
        jmpesquisa = new javax.swing.JMenuItem();
        jmhistorico = new javax.swing.JMenuItem();
        jmanexar = new javax.swing.JMenuItem();
        jmvisualizar = new javax.swing.JMenuItem();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jftcp = new javax.swing.JFormattedTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jftca = new javax.swing.JFormattedTextField();
        jLabel5 = new javax.swing.JLabel();
        jbtpesqusar = new javax.swing.JButton();
        dp_inicial = new net.sf.nachocalendar.components.DatePanel();
        dp_final = new net.sf.nachocalendar.components.DatePanel();
        jckpesquisa = new javax.swing.JCheckBox();
        jckverifica = new javax.swing.JCheckBox();
        jLabel6 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jcb_analitico = new javax.swing.JCheckBox();
        jck_desc_tarefa = new javax.swing.JCheckBox();
        jck_desc_inicial = new javax.swing.JCheckBox();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jftct = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtbtarefas = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        jbtexecutar = new javax.swing.JButton();
        jbthistorico = new javax.swing.JButton();
        jbtntarefa = new javax.swing.JButton();
        jbt_imprimir = new javax.swing.JButton();
        jbt_visualizar = new javax.swing.JButton();
        jbtanexar = new javax.swing.JButton();
        jbtatualiza = new javax.swing.JButton();
        jCheckBox1 = new javax.swing.JCheckBox();

        jPopupMenu1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jPopupMenu1MouseClicked(evt);
            }
        });

        jmpesquisa.setText("jMenuItem1");
        jmpesquisa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmpesquisaActionPerformed(evt);
            }
        });
        jPopupMenu1.add(jmpesquisa);

        jmhistorico.setText("jMenuItem2");
        jmhistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmhistoricoActionPerformed(evt);
            }
        });
        jPopupMenu1.add(jmhistorico);

        jmanexar.setText("jMenuItem3");
        jmanexar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmanexarActionPerformed(evt);
            }
        });
        jPopupMenu1.add(jmanexar);

        jmvisualizar.setText("jMenuItem4");
        jmvisualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmvisualizarActionPerformed(evt);
            }
        });
        jPopupMenu1.add(jmvisualizar);

        setClosable(true);
        setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Agenda");
        setToolTipText("");
        setMinimumSize(new java.awt.Dimension(805, 565));
        setVisible(true);
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameActivated(evt);
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameClosed(evt);
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameOpened(evt);
            }
        });
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentHidden(java.awt.event.ComponentEvent evt) {
                formComponentHidden(evt);
            }
            public void componentMoved(java.awt.event.ComponentEvent evt) {
                formComponentMoved(evt);
            }
            public void componentResized(java.awt.event.ComponentEvent evt) {
                formComponentResized(evt);
            }
            public void componentShown(java.awt.event.ComponentEvent evt) {
                formComponentShown(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtro"));

        jLabel1.setText("Data Inicial");

        jLabel2.setText("Data Final");

        jftcp.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        jftcp.setText("0");

        jLabel3.setText("Código do processo :");

        jLabel4.setText("Códido da atividade :");

        jftca.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        jftca.setText("0");
        jftca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jftcaActionPerformed(evt);
            }
        });

        jLabel5.setText("Tarefa contenha      :");

        jbtpesqusar.setText("Pesquisar");
        jbtpesqusar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtpesqusarActionPerformed(evt);
            }
        });

        jckpesquisa.setText("Tarefas concluídas");

        jckverifica.setSelected(true);
        jckverifica.setText("Verifica data");

        jLabel6.setText("Prazo                       :");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Todos", "Atrasados", "Normais" }));

        jcb_analitico.setText("Analítico");

        jck_desc_tarefa.setText("Desc. tarefa");
        jck_desc_tarefa.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jck_desc_tarefaItemStateChanged(evt);
            }
        });
        jck_desc_tarefa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jck_desc_tarefaActionPerformed(evt);
            }
        });

        jck_desc_inicial.setText("Contenha");
        jck_desc_inicial.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jck_desc_inicialStateChanged(evt);
            }
        });
        jck_desc_inicial.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jck_desc_inicialItemStateChanged(evt);
            }
        });
        jck_desc_inicial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jck_desc_inicialActionPerformed(evt);
            }
        });

        jButton3.setText("Pesq. Atividade");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("Pesq. Processo");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(dp_inicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(dp_final, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(185, 185, 185)
                        .addComponent(jLabel2)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6))
                        .addGap(16, 16, 16)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jftct)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jftca, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jftcp, javax.swing.GroupLayout.Alignment.LEADING))
                                .addGap(17, 17, 17)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jckverifica)
                            .addComponent(jckpesquisa))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jck_desc_inicial, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jbtpesqusar))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jcb_analitico)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jck_desc_tarefa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jftcp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jftca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4)
                            .addComponent(jButton3))
                        .addGap(9, 9, 9)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(jftct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(2, 2, 2)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jckpesquisa)
                            .addComponent(jcb_analitico)
                            .addComponent(jck_desc_tarefa))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jbtpesqusar)
                            .addComponent(jckverifica)
                            .addComponent(jck_desc_inicial)))
                    .addComponent(dp_inicial, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)
                    .addComponent(dp_final, 0, 0, Short.MAX_VALUE)))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Tarefas em aberto"));

        jtbtarefas.setToolTipText("Selecione uma linha");
        jtbtarefas.getTableHeader().setReorderingAllowed(false);
        jtbtarefas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtbtarefasMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jtbtarefas);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)
        );

        jPanel3.setLayout(new java.awt.GridBagLayout());

        jbtexecutar.setText("Executar");
        jbtexecutar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtexecutarActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(2, 10, 0, 0);
        jPanel3.add(jbtexecutar, gridBagConstraints);

        jbthistorico.setText("Histórico");
        jbthistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbthistoricoActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(2, 6, 1, 0);
        jPanel3.add(jbthistorico, gridBagConstraints);

        jbtntarefa.setText("Nova Tarefa");
        jbtntarefa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtntarefaActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
        jPanel3.add(jbtntarefa, gridBagConstraints);

        jbt_imprimir.setText("Imprimir");
        jbt_imprimir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_imprimirActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
        jPanel3.add(jbt_imprimir, gridBagConstraints);

        jbt_visualizar.setText("Visualizar Anexos");
        jbt_visualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_visualizarActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
        jPanel3.add(jbt_visualizar, gridBagConstraints);

        jbtanexar.setText("Anexar...");
        jbtanexar.setToolTipText("Anexar Documentos");
        jbtanexar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtanexarActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
        jPanel3.add(jbtanexar, gridBagConstraints);

        jbtatualiza.setText("Atualizar Tabela");
        jbtatualiza.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtatualizaActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 6;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
        jPanel3.add(jbtatualiza, gridBagConstraints);

        jCheckBox1.setFont(new java.awt.Font("Tahoma", 0, 9)); // NOI18N
        jCheckBox1.setText("Alerta de Atraso");
        jCheckBox1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jCheckBox1StateChanged(evt);
            }
        });
        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox1ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 7;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(4, 2, 0, 1);
        jPanel3.add(jCheckBox1, gridBagConstraints);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(20, 20, 20))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        setBounds(10, 10, 800, 561);
    }// </editor-fold>//GEN-END:initComponents

    private void jbtexecutarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtexecutarActionPerformed
        
        try{
            selectionListener.valueChanged(null);
            int linha = jtbtarefas.getSelectedRow();
            if(linha == -1)
            {
                JOptionPane.showMessageDialog(null, "Não há tarefa selecionada, verifique!");
                return;
            }
            int idtarefa =  Integer.valueOf(String.valueOf(jtbtarefas.getValueAt(linha,0)));
            
            
            boolean vencimento = new ProcAtivDao().consultaPrazo(idtarefa,true);
            Transicao trans = new ProcAtivDao().getTransicao(idtarefa);                     
            new EscolheFinView(null, true, trans).setVisible(true);

            tarefas();

            }catch(SQLException sql)
            {
               if(sql.getErrorCode() != 0)
               {
                   JOptionPane.showMessageDialog(null, sql.getMessage());
                }else
               {
                   JOptionPane.showMessageDialog(null, "Tarefa já encerrada por outro usuário","Aviso",JOptionPane.INFORMATION_MESSAGE);
                   jbtpesqusar.doClick();
                }
            }
    }//GEN-LAST:event_jbtexecutarActionPerformed

    private ListSelectionListener selectionListener = new ListSelectionListener()
    {
        public void valueChanged(ListSelectionEvent e)
        {
             try{

            int linha = jtbtarefas.getSelectedRow();
            if(linha == -1)
            {
                //JOptionPane.showMessageDialog(null, "Não há tarefa selecionada, verifique!");
                return;
            }
            int idtarefa =  Integer.valueOf(String.valueOf(jtbtarefas.getValueAt(linha,6)));
            if(idtarefa != 0)
            {
                String valor;
                valor = new ProcAtivDao().setTooltext(idtarefa);
                desctarefa.setValor(valor);
                int sequencia  = new ProcAtivDao().retornaSequencia(idtarefa);
                desctarefa.setSequencia(sequencia);
                desctarefa.liberabotaofrente(false);
                desctarefa.liberabotaoretorno(true);
                desctarefa.setIdatarefa(idtarefa);
                jtbtarefas.setToolTipText(valor);

            }
            //String desc = String.valueOf(jtbtarefas.getValueAt(linha, 2));
            //jtbtarefas.setToolTipText(desc);
        }catch(Exception exc)
        {
            JOptionPane.showMessageDialog(null, exc.getMessage(),"Erro desconhecido",0);
        }

        }


    };

    private void jbthistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbthistoricoActionPerformed
            /*
            DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
            try{
            Date data1 = new Date(2009, 11, 05, 11, 02, 30);
            Date data2 = new Date(2009, 11, 06, 9, 50, 29);
            System.out.println(data1);
            System.out.println(data2);

            long diferenca = data2.getTime() - data1.getTime();
            System.out.println("Horas: " + diferenca / (1000 * 60 * 60));
            System.out.println("Minutos: " + diferenca % (1000 * 60 * 60) / (1000 * 60));
            System.out.println("Segundos: " + (diferenca % (1000 * 60 * 60))% (1000 * 60) / 1000);
            }catch(Exception e)
            {
                
            }*/

         try{

            int linha = jtbtarefas.getSelectedRow();
            if(linha == -1)
            {
                JOptionPane.showMessageDialog(null, "Não há tarefa selecionada, verifique!");
                return;
            }
            
            int idtarefa =  Integer.valueOf(String.valueOf(jtbtarefas.getValueAt(linha,6)));
            Transicao trans= null;
            
            if(idtarefa == 0)
            {
              jtbtarefas.setValueAt(jtbtarefas.getValueAt(linha, 0), linha, 6);
              idtarefa =  Integer.valueOf(String.valueOf(jtbtarefas.getValueAt(linha,0)));
            }
            
            Agenda agenda = new ProcAtivDao().getAgenda(idtarefa);
            idtarefa =  Integer.valueOf(String.valueOf(jtbtarefas.getValueAt(linha,6)));
            //boolean vencimento = new ProcAtivDao().consultaPrazo(idtarefa);
            
            if(!jckpesquisa.isSelected())
            {
                trans = new ProcAtivDao().getTransicao(idtarefa);
            }else
            {
               trans = new Transicao(agenda.getIdtarefa(), agenda.getIdativ(), agenda.getIdproc(), 0, agenda.getIdusuario(), 0, new Date(agenda.getDt_inicial()), 0, agenda.getIdtarefa(), agenda.getPai(),agenda.getSolicitante());
            }
            //    JOptionPane.showMessageDialog(null, trans.getTransicao());
            //if(vencimento)new EscolheFinView(null, true, trans).setVisible(true);
            
            new HistoricoProcessoView(null, true, trans).setVisible(true);

            

            }catch(SQLException sql)
            {
                sql.printStackTrace();
                JOptionPane.showMessageDialog(null,"Tarefa inicial, não possui histórico!","Alerta",1);
            }


    }//GEN-LAST:event_jbthistoricoActionPerformed

    private void jftcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jftcaActionPerformed
        
    }//GEN-LAST:event_jftcaActionPerformed

    private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown

        

    }//GEN-LAST:event_formComponentShown

    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened

        

    }//GEN-LAST:event_formInternalFrameOpened

    private void jbtntarefaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtntarefaActionPerformed
        new TarefaView(null, true, this).setVisible(true);
    }//GEN-LAST:event_jbtntarefaActionPerformed

    private void formInternalFrameActivated(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameActivated

    }//GEN-LAST:event_formInternalFrameActivated

    private void jbtatualizaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtatualizaActionPerformed
        tarefas();
        jftcp.setText("0");
        jftca.setText("0");
        jftct.setText("");
        jckpesquisa.setSelected(false);
        jckverifica.setSelected(false);
        dp_final.setDate(new Date());
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(dp_final.getDate());
        calendar.add(calendar.DAY_OF_YEAR, 5);
        dp_final.setDate(calendar.getTime());
        for(int cont = 0 ; cont < jtbtarefas.getRowCount(); cont++)
        {
            try{
                int idtarefa =  Integer.valueOf(String.valueOf(jtbtarefas.getValueAt(cont,0)));
                boolean vencimento = new ProcAtivDao().consultaPrazo(idtarefa,false);

            }catch(SQLException sql)
            {
                JOptionPane.showMessageDialog(null, sql.getMessage());
            }
        }
        jbtpesqusar.doClick();
    }//GEN-LAST:event_jbtatualizaActionPerformed

    private void formInternalFrameClosed(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameClosed
        
        FabricaConexoes.closeConnection();
    }//GEN-LAST:event_formInternalFrameClosed

    private void jbtpesqusarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtpesqusarActionPerformed
        
         int cp,ca,ct,prazo;
         Date data_inicial = dp_inicial.getDate();
         Date data_final = dp_final.getDate();
         prazo = jComboBox1.getSelectedIndex();
         String contem = jftct.getText();
         if(contem.compareToIgnoreCase("") == 0)
         {
            jck_desc_inicial.setSelected(false);
         }
         try
         {
           cp = Integer.valueOf( jftcp.getText());
         }catch(NumberFormatException nfe)
         {
             cp = 0;
         }
         try
         {
           ca = Integer.valueOf( jftca.getText());
         }catch(NumberFormatException nfe)
         {
             ca = 0;
         }
         //try
         //{
           //ct = Integer.valueOf( jftct.getText());
         //}catch(NumberFormatException nfe)
         //{
             ct = 0;
         //}
         try
         {

             if(jckpesquisa.isSelected())
             {
                 if(jckverifica.isSelected())
                 {
                     new ProcAtivDao().pesquisaAgenda(jtbtarefas, data_inicial, data_final,cp,ca,ct,true,prazo,jcb_analitico.isSelected(),jck_desc_inicial.isSelected(),contem);
                 }
                 else
                 {
                     new ProcAtivDao().pesquisaAgenda(jtbtarefas, data_inicial, data_final,cp,ca,ct,false,prazo,jcb_analitico.isSelected(),jck_desc_inicial.isSelected(),contem);
                 }
             }
             else
             {
                 if(jckverifica.isSelected())
                 {
                     new ProcAtivDao().pesquisa(jtbtarefas, data_inicial, data_final,cp,ca,ct,true,prazo,jck_desc_inicial.isSelected(),contem);
                 }
                 else
                 {
                     new ProcAtivDao().pesquisa(jtbtarefas, data_inicial, data_final,cp,ca,ct,false,prazo,jck_desc_inicial.isSelected(),contem);
                 }
             }

         }catch(SQLException ex)
         {
             JOptionPane.showMessageDialog(null, ex.getMessage());
         }
    }//GEN-LAST:event_jbtpesqusarActionPerformed

    private void inicializaMenu()
    {
        jtbtarefas.add(jPopupMenu1);
        jmpesquisa.setText("Pesquisar por Solicitante");
       jmpesquisa.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(ActionEvent e) {


               //jMenuItem1ActionPerformed(e);
            }
        });
       jmhistorico.setText("Histórico");
       jmhistorico.addActionListener(new java.awt.event.ActionListener() {

                public void actionPerformed(ActionEvent e) {

                }
            });
      jmanexar.setText("Anexar arquivos");
      jmanexar.addActionListener(new java.awt.event.ActionListener() {

                public void actionPerformed(ActionEvent e) {

                }
            });
       jmvisualizar.setText("Visualizar anexos");
       jmvisualizar.addActionListener(new java.awt.event.ActionListener() {

                public void actionPerformed(ActionEvent e) {

                }
            });
    }

    private void jck_desc_inicialStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jck_desc_inicialStateChanged

        
    }//GEN-LAST:event_jck_desc_inicialStateChanged

    private void formComponentHidden(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentHidden
        
    }//GEN-LAST:event_formComponentHidden

    private void jck_desc_inicialItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jck_desc_inicialItemStateChanged
//        if(jck_desc_inicial.isSelected())
//        {
////            desc.setVisible(true);
//
//        }else
//        {
////            desc.setVisible(false);
//
//        }



    }//GEN-LAST:event_jck_desc_inicialItemStateChanged

    private void jck_desc_tarefaItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jck_desc_tarefaItemStateChanged
        if(jck_desc_tarefa.isSelected())
        {
            desctarefa.setVisible(true);
            principal.jdpprincipal.add(desctarefa);
            desctarefa.setBounds(0,0,desctarefa.getWidth(),principal.getHeight()-30);
            Rectangle retangulo = this.getBounds();
            if(retangulo.getX() < 276 )
            {
                this.setBounds(276,Integer.parseInt(String.valueOf(Math.round(this.getBounds().getY()))),this.getWidth(),this.getHeight());
            }
            desctarefa.repaint();
            principal.repaint();
            

        }else
        {
            desctarefa.setVisible(false);
            principal.jdpprincipal.remove(desctarefa);
        }
    }//GEN-LAST:event_jck_desc_tarefaItemStateChanged

    private void jbt_imprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_imprimirActionPerformed
        new ImprimirJTable(jtbtarefas);
        FabricaConexoes.closeAllConnections();
//        if(!FabricaConexoes.verificaConexao()) FabricaConexoes.ConectaOracle();
//        manipulaConexao.preenchetable(jtbtarefas, "select * from par_empresas");
//        FabricaConexoes.closeConnection();
    }//GEN-LAST:event_jbt_imprimirActionPerformed

    private void jbtanexarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtanexarActionPerformed
//        new AnexoView(null,true).setVisible(true);
        selectionListener.valueChanged(null);
            int linha = jtbtarefas.getSelectedRow();
            if(linha == -1)
            {
                JOptionPane.showMessageDialog(null, "Não há tarefa selecionada, verifique!");
                return;
            }
            int idtarefa =  Integer.valueOf(String.valueOf(jtbtarefas.getValueAt(linha,0)));

        final JFileChooser fc = new JFileChooser();
        int res = fc.showOpenDialog(null);
        
        if(res == JFileChooser.APPROVE_OPTION){
          File arquivo = fc.getSelectedFile();
          
            try{
                new ProcAtivDao().gravaAnexo(arquivo, idtarefa);
                }catch(Exception sql)
                      {
                            JOptionPane.showMessageDialog(null, sql.getMessage());
                            }
                
          JOptionPane.showMessageDialog(null,"O arquivo: " + arquivo.getName() + " foi adicionado!");
        }
        else
          JOptionPane.showMessageDialog(null,"Voce nao selecionou nenhum arquivo.");


    }//GEN-LAST:event_jbtanexarActionPerformed

    private void jck_desc_inicialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jck_desc_inicialActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jck_desc_inicialActionPerformed

    private void jbt_visualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_visualizarActionPerformed

        
        int linha = jtbtarefas.getSelectedRow();
            if(linha == -1)
            {
                JOptionPane.showMessageDialog(null, "Não há tarefa selecionada, verifique!");
                return;
            }
            int idtarefa =  Integer.valueOf(String.valueOf(jtbtarefas.getValueAt(linha,0)));
            new VisualizaAnexos(principal, true, idtarefa).setVisible(true);



    }//GEN-LAST:event_jbt_visualizarActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
            String sql = "Select idprocesso, nome, descricao from  processo ";
            int id = 0;
            pesquisa pesquisa;
            pesquisa = new pesquisa(principal, true, sql, id);
            pesquisa.setVisible(true);
            jftcp.setText(String.valueOf(pesquisa.getId()));
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
            String sql = "Select idatividade, nome, descricao from  atividade ";
            int id = 0;
            pesquisa pesquisa;
            pesquisa = new pesquisa(principal, true, sql, id);
            pesquisa.setVisible(true);
            jftca.setText(String.valueOf(pesquisa.getId()));
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jCheckBox1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jCheckBox1StateChanged
            

    }//GEN-LAST:event_jCheckBox1StateChanged

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed

        if(jCheckBox1.isSelected())
            {

                if(inicio == 0)
                {
                    alerta.setAlerta(0);
                    alertatask = new AlertaTask(10, this,alerta);
                    alerta.setVisible(false);
                    alerta.setState(java.awt.Frame.ICONIFIED);
                    inicio = 1;
                }else
                {
                    alerta.setAlerta(0);
                    alerta.setVisible(false);
                    alerta.setState(java.awt.Frame.ICONIFIED);
                    //inicio = 1 ;
                }
            }else{
            
                alerta.dispose();               
                alerta.setAlerta(1);
            }

    }//GEN-LAST:event_jCheckBox1ActionPerformed

    private void jmpesquisaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmpesquisaActionPerformed
        
        TableRowSorter<TableModel> sorter;
        sorter = new TableRowSorter<TableModel>(jtbtarefas.getModel());
        jtbtarefas.setRowSorter(sorter);
        sorter.setRowFilter(javax.swing.RowFilter.regexFilter(JOptionPane.showInputDialog(null,"Solicitante: ","Busca",JOptionPane.INFORMATION_MESSAGE), 3));
        inativaMenu();
    }//GEN-LAST:event_jmpesquisaActionPerformed

    private void inativaMenu()
    {
        jPopupMenu1.setVisible(false);
        jPopupMenu1.setEnabled(false);
    }

    private void jmhistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmhistoricoActionPerformed
        jbthistorico.doClick();
        inativaMenu();
    }//GEN-LAST:event_jmhistoricoActionPerformed

    private void jmanexarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmanexarActionPerformed
        jbtanexar.doClick();
        inativaMenu();
    }//GEN-LAST:event_jmanexarActionPerformed

    private void jmvisualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmvisualizarActionPerformed
        jbt_visualizar.doClick();
        inativaMenu();
    }//GEN-LAST:event_jmvisualizarActionPerformed

    private void jck_desc_tarefaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jck_desc_tarefaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jck_desc_tarefaActionPerformed

    private void jtbtarefasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtbtarefasMouseClicked
        
        if(evt.getClickCount() == 2)
        {
            //jtbtarefas.valueChanged(null);
            jbtexecutar.doClick();
        }
       if(evt.getButton() == 1)
       {
         inativaMenu();
       }
       if(evt.getButton() == 3){
       
       jPopupMenu1.setEnabled(true);
       jPopupMenu1.setVisible(true);
       jPopupMenu1.setLocation(evt.getLocationOnScreen());
       
       }
        
        
    }//GEN-LAST:event_jtbtarefasMouseClicked

    private void jPopupMenu1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPopupMenu1MouseClicked
        jPopupMenu1.setVisible(false);
    }//GEN-LAST:event_jPopupMenu1MouseClicked

    private void formComponentMoved(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentMoved
        if(desctarefa.isVisible())
        {
            if(this.getBounds().getX() < 276)
            {
                this.setBounds(276,Integer.parseInt(String.valueOf(Math.round(this.getBounds().getY()))),this.getWidth(),this.getHeight());
            }
        }
    }//GEN-LAST:event_formComponentMoved

    private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
           if(this.getWidth()>= principal.getWidth()-277 && desctarefa.isVisible())
           {
              
                   this.setBounds(276,0,principal.getWidth()-289,principal.getHeight()-55);
                   JOptionPane.showMessageDialog(null, "resiz");
             
           
           }
           
           if(this.getBounds().getWidth()<= 806)
           {
               this.setBounds(Integer.parseInt(String.valueOf(this.getBounds().getX())),Integer.parseInt(String.valueOf(this.getBounds().getY())),805,Integer.parseInt(String.valueOf(this.getBounds().getHeight())));
           }
           if(this.getBounds().getHeight() <= 566)
           {
               this.setBounds(Integer.parseInt(String.valueOf(this.getBounds().getX())),Integer.parseInt(String.valueOf(this.getBounds().getY())),Integer.parseInt(String.valueOf(this.getBounds().getWidth())),565);
           }
    }//GEN-LAST:event_formComponentResized

    public void tarefas()
    {        
        new ProcAtivDao().carregaTarefas(jtbtarefas);        
        jtbtarefas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        jbtpesqusar.doClick();
    }

    public void Atualizar()
    {
        jbtatualiza.doClick();
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private net.sf.nachocalendar.components.DatePanel dp_final;
    private net.sf.nachocalendar.components.DatePanel dp_inicial;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbt_imprimir;
    private javax.swing.JButton jbt_visualizar;
    private javax.swing.JButton jbtanexar;
    public javax.swing.JButton jbtatualiza;
    private javax.swing.JButton jbtexecutar;
    private javax.swing.JButton jbthistorico;
    private javax.swing.JButton jbtntarefa;
    private javax.swing.JButton jbtpesqusar;
    private javax.swing.JCheckBox jcb_analitico;
    private javax.swing.JCheckBox jck_desc_inicial;
    private javax.swing.JCheckBox jck_desc_tarefa;
    private javax.swing.JCheckBox jckpesquisa;
    private javax.swing.JCheckBox jckverifica;
    private javax.swing.JFormattedTextField jftca;
    private javax.swing.JFormattedTextField jftcp;
    private javax.swing.JTextField jftct;
    private javax.swing.JMenuItem jmanexar;
    private javax.swing.JMenuItem jmhistorico;
    private javax.swing.JMenuItem jmpesquisa;
    private javax.swing.JMenuItem jmvisualizar;
    public javax.swing.JTable jtbtarefas;
    // End of variables declaration//GEN-END:variables
    private DateFormat dtformat;
    DescTarefaView2 desctarefa = new DescTarefaView2("");
    DescView desc = new DescView("");
    Principal principal;
    Alerta alerta = new Alerta();
    AlertaTask alertatask;
    int inicio = 0;
}
